<?php

include 'LoggerStub.php';

include 'eu/freeplace/validator/Validator.php';
include 'eu/freeplace/validator/ValidateISBN.php';

use eu\freeplace\validator\ValidateISBN as ValidateISBN;

/**
 * @author Elmar Dott
 */
class ValidateISBNTest extends \PHPUnit_Framework_TestCase {
 
    public function testIsISBN_10() {

        $validator = new ValidateISBN();
        $this->assertEquals(1, $validator->testISBN10("0-8044-2957-X"));
        $this->assertEquals(1, $validator->testISBN10("386647 0479"));
        $this->assertEquals(1, $validator->testISBN10("3-499-13599- x"));
        $this->assertEquals(1, $validator->testISBN10("3-4 86 - 24350-0"));
        
        //False Checksum
        $this->assertEquals(0, $validator->testISBN10("3-4 86 - 27350-0"));
        // too long
        $this->assertEquals(0, $validator->testISBN10("0123456789012"));
        $this->assertEquals(0, $validator->testISBN10("012345678901"));
        // too short
        $this->assertEquals(0, $validator->testISBN10("012345678"));
        //false Symbols
        $this->assertEquals(0, $validator->testISBN10("012345678a"));
    }
    
}//CLASS

?>